<template>
  <div class="tablewrap">
    <div>预约安排</div>
    <FilterTable :columns="columns" :isColumnFilter="false" :dataSource="dataSource" :height="200" :onColumnsChange="columns => (this.columns = columns)" :isSelectColumn="false"></FilterTable>
  </div>
</template>

<script>
import moment from 'moment';
import { queryBookingOrder } from '@/api/repair/business/customer/monitoring.js';

export default {
  name: 'YuYueAnPai',
  data() {
    return {
      // 预约安排
      dataSource: [],
      columns: this.createColumnsAppointment()
    };
  },
  mounted() {
    this.queryBookingOrder();
  },
  methods: {
    async queryBookingOrder() {
      const params = {
        sort: 'BOOKING_ORDER_NO',
        order: 'asc',
        limit: 10,
        offset: 0,
        LICENSE: '陕A2FU00',
        undefined: 10015,
        vin: '09876543219876543',
        ownerNo: 'OW1907110001',
        BRAND: 'LINCOLN',
        MILEAGE: 999999,
        isRepairOrder: 'REPAIR_ORDER_TAG',
        createDate: moment().format('YYYY-MM-DD HH-mm'),
        monitor_table: '',
        activity1_table: '',
        activity2_table: '',
        booking_table: '',
        insurance_table: '',
        warning_table: '',
        dmsFuncId: 35100010,
        _: moment().valueOf()
      };
      console.log(params);
      const res = await queryBookingOrder(params);
      console.log(res);
      this.dataSource = res;
    },
    createColumnsAppointment() {
      return [
        {
          title: '序号'
        },
        {
          title: '预约单号',
          dataIndex: '预约单号'
        },
        {
          title: 'VIN',
          dataIndex: 'VIN'
        },
        {
          title: '预约类别',
          dataIndex: 'BOOKING_TYPE_NAME'
        },
        {
          title: '预约进厂时间',
          dataIndex: 'BOOKING_COME_TIME'
        },
        {
          title: '联系人',
          dataIndex: 'CONTACTOR_NAME'
        },
        {
          title: '指定技师',
          dataIndex: 'CHIEF_TECHNICIAN'
        },
        {
          title: '锁定人',
          dataIndex: 'LOCK_USER'
        },
        {
          title: '创建时间',
          dataIndex: 'CREATED_AT'
        },
        {
          title: '备注',
          dataIndex: 'REMARK'
        }
      ];
    }
  }
};
</script>

<style scoped></style>
